/*
day78
2019.11.14
*/
#include<stdlib.h>

struct TreeNode {
	int val;
	struct TreeNode *left;
	struct TreeNode *right;
};

void help(struct TreeNode *root,struct TreeNode* pre[])
{
	if(!root) return ;
	struct TreeNode *left=root->left;
	struct TreeNode *right=root->right;
	
	pre[0]->right=root;
	pre[0]->left=NULL;
	pre[0]=root;
	
	help(left,pre);
	help(right,pre);
	
}

void flatten(struct TreeNode* root)
{
	struct TreeNode* pre[] = {(struct TreeNode *)malloc( sizeof(struct TreeNode)) };
	help(root,pre);
}

int main()
{
	return 0;
}
